package classes;

import components.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class MenuPanel extends JPanel {

    CButton btnPatient = new CButton("managepatient.png", 100, 100); 
    CButton btnReport = new CButton("report.png", 100, 100); 
    CButton btnExit = new CButton("exit.png", 100, 100); 
    JLabel lblMenu = new JLabel("Main Menu");
  

    public MenuPanel()
    {
        setLayout(null);
        setVisible(true);
        setOpaque(false);

        setButton(btnPatient, "managepatient2.png",  20, 200);
        setButton(btnReport, "report2.png", 20, 350);
        setButton(btnExit, "exit2.png", 20, 500);

        add(lblMenu);
        lblMenu.setFont(new Font("Lucida Bright", Font.BOLD, 24));
        lblMenu.setForeground(Color.white);
        lblMenu.setBounds(20,130,250,30);
        
        btnPatient.addMouseListener(new MouseListener(){
        public void mouseClicked(MouseEvent e) {

        }

        public void mousePressed(MouseEvent e) {

        }

        public void mouseReleased(MouseEvent e) {

        }

        public void mouseEntered(MouseEvent e) {
               lblMenu.setText("Patient Management");
        }

        public void mouseExited(MouseEvent e) {
              lblMenu.setText("Main Menu");
        }
        });
        
         btnReport.addMouseListener(new MouseListener(){
        public void mouseClicked(MouseEvent e) {

        }

        public void mousePressed(MouseEvent e) {

        }

        public void mouseReleased(MouseEvent e) {

        }

        public void mouseEntered(MouseEvent e) {
               lblMenu.setText("Report Generation");
        }

        public void mouseExited(MouseEvent e) {
               lblMenu.setText("Main Menu");
        }
        });

         
       btnExit.addMouseListener(new MouseListener(){
        public void mouseClicked(MouseEvent e) {

        }

        public void mousePressed(MouseEvent e) {

        }

        public void mouseReleased(MouseEvent e) {

        }

        public void mouseEntered(MouseEvent e) {
               lblMenu.setText("Exit Program");
        }

        public void mouseExited(MouseEvent e) {
               lblMenu.setText("Main Menu");
        }
        });

    }
    
   
    private void setButton(CButton button, String rollover, int x, int y)
    {
        add(button);
        button.setRollover(rollover);
        button.setLocation(x,y);
    }

}
